import type { EnumMyChatCardAction, MyChatMsgResult } from "@/api/siderBar/model"

interface RequestCardEvent {
    type: "handleRequestCard"
    message: MyChatMsgResult
    action: EnumMyChatCardAction
    actionType: "reject" | "agreen"
}

interface PreviewResumeEvent {
    type: "previewResume",
    source: string
}

interface MessageCopyEvent {
    type: "copyText",
    content: string
}

export type MessageListAnyEvent = RequestCardEvent
                                | PreviewResumeEvent
                                | MessageCopyEvent

export type AnyEventManager = {
    [K in MessageListAnyEvent as K['type']]: (payload: Extract<MessageListAnyEvent, { type: K['type'] }>) => any
}